import Mock from 'mockjs'

//图表数据
let list=[]

export default {
    getStatisticalData:()=>{
        //产生随机数100-8000之间，保留小数 最小0位
        for (let i = 0; i < 7; i++) {
            list.push(
                Mock.mock({
                    苹果:Mock.Random.float(100,8000,0,0),
                    vivo:Mock.Random.float(100,8000,0,0),
                    oppo:Mock.Random.float(100,8000,0,0),
                    三星:Mock.Random.float(100,8000,0,0),
                    小米:Mock.Random.float(100,8000,0,0),
                    魅族:Mock.Random.float(100,8000,0,0),
                })
            )

        }

        return {
            code:20000,
            data:{
                //    饼图
                videoData:[
                    {name:'小米',value:299},
                    {name:'苹果',value:399},
                    {name:'oppo',value:429},
                    {name:'vivo',value:324},
                    {name:'三星',value:292},
                    {name:'魅族',value:398},
                ],
                tableData:[
                    {name:'oppo',todayBuy:500,monthBuy:3500,totalBuy:22000},
                    {name:'vivo',todayBuy:500,monthBuy:3500,totalBuy:22000},
                    {name:'苹果',todayBuy:500,monthBuy:3500,totalBuy:22000},
                    {name:'三星',todayBuy:500,monthBuy:3500,totalBuy:22000},
                    {name:'魅族',todayBuy:500,monthBuy:3500,totalBuy:22000},
                    {name:'小米',todayBuy:500,monthBuy:3500,totalBuy:22000},
                ],
                //    折线图
                orderData:{
                    date:['20191001','20191002','20191003','20191004','20191005','20191006','20191007'],
                    data:list
                },
                //      柱状图
                userData:[
                    {date:'周一',new:45,active:200},
                    {date:'周二',new:37,active:60},
                    {date:'周三',new:85,active:100},
                    {date:'周四',new:92,active:120},
                    {date:'周五',new:130,active:152},
                    {date:'周六',new:121,active:123},
                    {date:'周日',new:152,active:94},
                ],
            }
        }
    }
}
